Carbon


HasDepth

Header: Palettes.h Carbon status: Supported

Determines whether a video device supports a specific pixel depth.

SInt16 HasDepth (
    GDHandle gd, 
    SInt16 depth, 
    SInt16 whichFlags, 
    SInt16 flags
);
Parameter descriptions
gd

A handle to the GDevice structure of the video device.

depth

The pixel depth for which you’re testing.

whichFlags

The gdDevType constant, which represents a bit in the gdFlags field of the GDevice structure. If this bit is set to 0 in the GDevice structure, the video device is black and white; if the bit is set to 1, the device supports color.

flags

The value 0 or 1. If you pass 0 in this parameter, the HasDepth function tests whether the video device is black and white. If you pass 1 in this parameter, HasDepth tests whether the video device supports color.

function result

Returns 0 if the device does not support the depth you specify in the depth parameter or the display mode you specify in the flags parameter.

Any other value indicates that the device supports the specified depth and display mode. The function result contains the mode ID that QuickDraw passes to the video driver to set its pixel depth and to specify color or black and white. You can pass this mode ID in the depth parameter for the SetDepth function to set the graphics device to the pixel depth and display mode for which you tested.

SPECIAL CONSIDERATIONS

The HasDepth function may move or purge blocks of memory in the application heap; do not call this function at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)